package org.huntaway.kindergarten.manager;

import java.util.List;

import org.huntaway.kernel.NutException;
import org.huntaway.kindergarten.po.ClassInfo;
import org.huntaway.kindergarten.util.EnumUse;

public class ClassInfoMng extends BaseMng<ClassInfo>{	
	@SuppressWarnings("unchecked")
	public List<ClassInfo> getClassInfo() {		
		return (List<ClassInfo>)dateManage.findbyhql("from ClassInfo").list();
	}
	public void save(ClassInfo item) {
		item.setIsuse(EnumUse.NO.getValue());
		//updateEntityUse(item);
		super.save(item);
	}
	public void delete(ClassInfo item) throws NutException {
		if (item.getIsuse().intValue() == EnumUse.YES.getValue()) {			
			throwException(item); 
		}
		super.delete(item);
	}	
}
